package priv.jesse.mall.web.user;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import priv.jesse.mall.entity.Classification;
import priv.jesse.mall.entity.pojo.ResultBean;
import priv.jesse.mall.service.ClassificationService;

import java.util.ArrayList;
import java.util.List;

@Controller
@RequestMapping("/classification")
public class ClassificationController {
    @Autowired
    private ClassificationService classificationService;


    @RequestMapping("/list.do")
    @ResponseBody
    public ResultBean<List<Classification>> findAll(int type) {
        List<Classification> list = new ArrayList<>();

            list = classificationService.findOrAll(type);

        return new ResultBean<>(list);
    }
}
